package com.example.springdemo6.controller;


import com.example.springdemo6.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//登录页面
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    LoginService loginService;
    //验证账号和密码
    @RequestMapping("/check")
    public boolean login(String userName, String password) {
        boolean login = loginService.login(userName, password);
        return login;
    }

    @RequestMapping("/index")
    public String index() {
        return "zhangsan";
    }
}
